package com.jctrip.hotel.source.xxl.elong;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jctrip.hotel.common.constant.XxlJobNameConstant;
import com.jctrip.hotel.common.util.JsonUtil;
import com.jctrip.hotel.domain.dao.HtSourceInfoDao;
import com.jctrip.hotel.domain.entity.HtSourceInfo;
import com.jctrip.hotel.source.model.CommonJobParam;
import com.jctrip.hotel.source.service.elong.ElongTaskService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author: zxy
 * @CreateTime: 2023-10-16 17:08
 * @Description:
 */

@Component
@Slf4j
public class SyncElongHotelProductChoseTaskPushXxlJob extends IJobHandler {
    @Autowired
    private ElongTaskService elongTaskService;
    @Resource
    private HtSourceInfoDao htSourceInfoDao;

    @Override
    @XxlJob(XxlJobNameConstant.SYNC_ELONG_HOTEL_CHOSE_RATES_PUSH)
    public void execute() throws Exception {
        XxlJobHelper.log(XxlJobNameConstant.SYNC_ELONG_HOTEL_CHOSE_RATES_PUSH + " xxl job start");

        try {
            elongTaskService.syncRatesChosePush();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
        }

        XxlJobHelper.log(XxlJobNameConstant.SYNC_ELONG_HOTEL_CHOSE_RATES_PUSH + " xxl job end");
    }
}